package com.yonyou.crm.sprc.oppdimension.rmimpl;

import com.yonyou.crm.common.page.entity.Page;
import com.yonyou.crm.sprc.oppdimension.entity.OppdimensionVO;
import com.yonyou.crm.sprc.oppdimension.rmitf.IOppdimensionRmService;
import com.yonyou.crm.sprc.oppdimension.service.OppdimensionBizServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service("oppdimensionService")
public class OppdimensionRmServiceImpl implements IOppdimensionRmService {

	@Autowired
	private OppdimensionBizServiceImpl service;

	@Override
	public Page<OppdimensionVO> getList(Page<OppdimensionVO> requestPage, Map<String, Object> searchMap) {
		return service.getList(requestPage, searchMap);
	}

	@Override
	public List<OppdimensionVO> getAll() {
		return service.getOppdimensionList(new HashMap());
	}

	@Override
	public OppdimensionVO detail(String id) {
		// TODO 自动生成的方法存根
		return null;
	}

	@Override
	public OppdimensionVO insert(OppdimensionVO vo) {
		OppdimensionVO oppdimensionVO = service.saveVO(vo);
		return oppdimensionVO;
	}

	@Override
	public OppdimensionVO update(OppdimensionVO vo) {
		OppdimensionVO oppdimensionVO = service.updateVO(vo);
		oppdimensionVO = service.getOppdimensionVOById(oppdimensionVO.getId());
		return oppdimensionVO;
	}

	@Override
	public Page<OppdimensionVO> batchDelete(String[] idArray, Page<OppdimensionVO> requestPage, Map<String, Object> searchMap) {
		service.batchDeleteByIDs(OppdimensionVO.class, idArray);
		return service.getList(requestPage, searchMap);
	}

	@Override
	public Page<OppdimensionVO> batchUpdateEnableState(String[] idArray, Integer enableState, Page<OppdimensionVO> requestPage, Map<String, Object> searchMap) {
		service.batchUpdateEnableState(idArray, enableState);
		return service.getList(requestPage, searchMap);
	}


}
